#include<bits/stdc++.h>
using namespace std;
#define N 510
int a[N][N];
int n;
int main()
{
    int n;
    while(cin >> n)
    {
        priority_queue<int>q;
        for(int i = 0; i < n; i ++)
        {
            for(int j = i + 1; j < n; j ++)
            {
                cin >> a[i][j];
                a[j][i] = a[i][j];

            }
        }
        int res = 0;
        for(int i = 0; i < n; i ++)
        {
            int f = 0,s = 0;
            for(int j = 0; j < n; j ++)
            {
                if(a[i][j] > f)
                {
                    s = f;
                    f = a[i][j];
                }
                else if(a[i][j] > s)
                {
                    s = a[i][j];
                }
                res = max(s,res);

            }
        }
        cout << "1" << endl;
        cout <<res << endl;
    }

}
